Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fixed-width-button-content): add component #423

Conversation

jor-row
Copy link
Collaborator

@jor-row jor-row commented Aug 20, 2023

Description

Adding a component to enable us to fix the width of a button with variable string contents. Example use case: mute/unmute in-meeting buttons

sb1

Links

Figma

@jor-row jor-row added validated If the pull request is validated automation. component labels Aug 20, 2023
Copy link
Collaborator

@nataliadelmar nataliadelmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this implementation. Could we pass it to be part of the ButtonPill and ButtonPillToggle components?

So, adding the stringContentVariations array as a prop to ButtonPill and ButtonPillToggle. It should be undefined by default. But if it is defined, then we should invisibly print all the variations in hidden mode as you did in this implementation. So the consumer would use it like this:

<ButtonPill
    scale={20}
    stringContentVariations = ['long', 'longer', 'longest']
>
   <Icon scale={28}/>
   <Text>Hello</Text>
</ButtonPill>

ButtonPill will know its own size. So from there, you can deduce the icon scale and text scale the invisible prints should have (nice work on that util btw!).

What do you think?

@jor-row jor-row closed this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component validated If the pull request is validated automation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants